<?php

namespace App\Http\Controllers\Console;

use App\Http\Controllers\Controller;
use App\Model\ShopModel;
use App\Model\ShopRegisterModel;
use Illuminate\Http\Request;
use Cblink\Region\Region;



class ShopController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $region = new Region();

        $values = $region->allProvinces(); // 全部省份
        return json_encode($values);
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create(Request $request)
    {

        $data = [
            'company_name' => $request->company_name,
            'logo' => $request->logo,
            'area_id' => $request->area_id,
            'user_name' => $request->user_name,
            'card_front' => $request->card_front,
            'card_back' => $request->card_back,
            'mobile' => $request->mobile,
            'business' => $request->business,
            'type' => $request->type,
            'status' => $request->status,
        ];

        $ShopRegisterModel = new ShopRegisterModel();
        $ShopRegisterModel->create($data);

      return ['msg'=>'申请成功，耐心等待审核','code'=>200];
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {


        $user = $request->user;


        return $user;
    }

    /**
     * Display the specified resource.
     *
     * @param  \App\Model\ShopModel  $shopModel
     * @return \Illuminate\Http\Response
     */
    public function show(ShopModel $shopModel)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  \App\Model\ShopModel  $shopModel
     * @return \Illuminate\Http\Response
     */
    public function edit(ShopModel $shopModel)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Model\ShopModel  $shopModel
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, ShopModel $shopModel)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\Model\ShopModel  $shopModel
     * @return \Illuminate\Http\Response
     */
    public function destroy(ShopModel $shopModel)
    {
        //
    }
}
